package avicit.bdp.dcs.semistructure.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @金航数码科技有限责任公司
 * @作者：liyb
 * @邮箱：liyb@avic-digital.com
 * @创建时间：2023-04-03 14:09
 * @类说明：文件模板字段DTO
 * @修改记录：
 */
@ApiModel(value = "TemplateFieldDTO", description = "bdp_dcs_file_template_field")
@Table(name = "bdp_dcs_file_template_field")
public class TemplateFieldDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    // 主键
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    // 模板ID
    @LogField
    @ApiModelProperty(value = "模板ID")
    @FieldRemark(column = "template_id", field = "templateId", name = "模板ID")
    @Column(name = "template_id")
    private String templateId;

    // 字段名称
    @LogField
    @ApiModelProperty(value = "字段名称")
    @FieldRemark(column = "name", field = "name", name = "字段名称")
    @Column(name = "name")
    private String name;

    // 字段类型
    @LogField
    @ApiModelProperty(value = "字段类型")
    @FieldRemark(column = "type", field = "type", name = "字段类型")
    @Column(name = "type")
    private String type;

    // 描述
    @LogField
    @ApiModelProperty(value = "描述")
    @FieldRemark(column = "remark", field = "remark", name = "描述")
    @Column(name = "remark")
    private String remark;

    // 字段顺序
    @LogField
    @ApiModelProperty(value = "字段顺序")
    @FieldRemark(column = "order_by", field = "orderBy", name = "字段顺序")
    @Column(name = "order_by")
    private Integer orderBy;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(Integer orderBy) {
        this.orderBy = orderBy;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "模板字段管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "模板字段";
        } else {
            return super.logTitle;
        }
    }

}